package com.byxy.entity;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 * 旅行社
 * 
 * @author ketsu
 *
 */
@Entity(name = "xt_agency")
public class Agency implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	private Integer id; // 序号
	@Column(length = 20)
	private String name; // 旅行社名称
	@Column(length = 20)
	private String code; // 旅行社代码
	@Column(length = 20)
	private String phone; // 旅行社电话
	@Column(length = 50)
	private String email; // 旅行社邮箱

	private String remark; // 备注
	@OneToMany(mappedBy = "agency")
	private Set<Order> orders = new HashSet<>();

	@OneToMany(mappedBy = "agency")
	private Set<Guide> guides = new HashSet<>();

	public Set<Guide> getGuides() {
		return guides;
	}

	public void setGuides(Set<Guide> guides) {
		this.guides = guides;
	}

	public Agency() {
		super();
	}

	public Agency(Integer id, String name, String code, String phone, String email, String remark) {
		super();
		this.id = id;
		this.name = name;
		this.code = code;
		this.phone = phone;
		this.email = email;
		this.remark = remark;
	}

	public Set<Order> getOrders() {
		return orders;
	}

	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}

	// get set����
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public String toString() {
		return "Agency [id=" + id + ", name=" + name + ", code=" + code + ", phone=" + phone + ", email=" + email
				+ ", remark=" + remark + "]";
	}

}
